package com.example.memurbac_service.dao;

import com.example.memurbac_service.pojo.RoleAuth;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface RoleAuthMapper
{

    /**
     * 给角色添加权限集合
     */
    @Insert("insert into role_auth values(#{param1},#{param2})")
    int addRoleAuths(int roleid, int authids);

    /**
     * 删除该角色所有权限
     */
    @Delete("delete from role_auth where role_id =#{roleid}")
    int delallRoleAuth(int roleid);


    /**
     * 查询角色绑定的权限集合
     */
    @Select("select auth_id from role_auth where role_id=#{roleid}")
    List<Integer> reachRoleAuths(int roleid);



}
